﻿using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace AspNetCore.MyCrawler.Utility
{
    public class JsonConfigurationHelper
    {
        public static string GetAppsettings(string key)
        {
            var builder = new ConfigurationBuilder()
                .SetBasePath(Directory.GetCurrentDirectory())
                .AddJsonFile("appsettings.json");
            var config = builder.Build();
            return config.GetSection(key).Value;
        }
    }
}
